package uestc.lj.leetcode.MT;


import java.io.*;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Queue;


/**
 * @Author:Crazlee
 * @Date:2021/12/26
 */
public class meituan003 {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		String[] mn = br.readLine().split(" ");
		int m = Integer.parseInt(mn[0]), n = Integer.parseInt(mn[1]);
		int[] w = new int[Integer.parseInt(mn[0])];
		int[] v = new int[Integer.parseInt(mn[0])];
		for (int i = 0; i < m; i++) {
			String[] line = br.readLine().split(" ");
			v[i] = Integer.parseInt(line[0]);
			w[i] = Integer.parseInt(line[1]);
		}
		br.close();
		Queue<int[]> queue = new PriorityQueue<>((o2, o1) -> o1[1] == o2[1] ? o2[0] - o1[0] : o1[1] - o2[1]);
		for (int i = 0; i < m; i++) {
			queue.add(new int[]{i, v[i] + 2 * w[i]});
		}
		int[] ans = new int[n];
		for (int i = 0; i < n; i++) {
			ans[i] = queue.poll()[0] + 1;
		}
		Arrays.sort(ans);
		for (int num : ans) {
			bw.write(num + " ");
		}
		bw.flush();
		bw.close();
	}
}
